import { MockMethod } from 'vite-plugin-mock';
import Mock from 'mockjs';

const mock: MockMethod[] = [
  {
    url: '/api/auth/info',
    method: 'get',
    response: () => {
      return {
        code: 200,
        message: '登录成功',
        type: 'success',
        data: {
          userName: '晴川历历汉阳树',
          userId: '77777',
          permission: ['TEXT_HANDLE', 'ADMIN'],
          imgUrl: Mock.Random.image('100x100'),
        },
      };
    },
  },
  {
    url: '/api/auth/login',
    method: 'post',
    response: () => {
      return {
        code: 200,
        message: '登录成功',
        type: 'success',
        data: {
          token: Mock.Random.string(10),
        },
      };
    },
  },
];

export default mock;
